$(function(){
	
//	案例列表模块
	var vm = new Vue({
		el:'#Main',
		data:{
			goodData:testData.product
		},
		methods:{
			
		},
		created:function(){
			imgRate();
		},
		mounted:function(){
			pullSwiper("#Main",true,true);
		},
	});
	
//	顶部筛选模块
	var screen = new Vue({
		el:'#goodMod',
		data:{
			list:null,
			spec:['价格降序','价格升序','销量降序'],
		},
		methods:{
			//单项筛选
			screen:function(e,type){
				$("#screenMask").remove();
				var that = this;
				var target = e.currentTarget;
				
				if(type == 1){
					//综合排序
					$('#goodMod dl').eq(type).addClass('on').siblings().removeClass('on active');
				}else if(type == 2){
					//价格销量排序
					let node = $('#goodMod dl').eq(type);
					let arr = that.spec;
					let check = target.getAttribute('data-check');
					if(node.hasClass('on')){
						//选中
						if(node.hasClass('active')){
							//关闭
							$('#goodMod dl').eq(type).removeClass('active');
						}else{
							//打开
							$('#goodMod dl').eq(type).addClass('active');
							caseRadio(arr,check,function(index){
								target.setAttribute('data-check',index);
								target.children[0].innerHTML = that.spec[index];
								target.className = 'flex-full flex-row on';
							});
						};
					}else{
						//未选中
						$('#goodMod dl').eq(type).addClass('on').siblings().removeClass('on');
					};
				}else{
					//选择分类
					var classData = testData.assort;
					that.list == null ? check = [0,0] : check = that.list;
					createAreaPick(function(arr){
						console.log(arr)
						that.list = arr;
					},classData,check,2);
				};
				
			},
			
		},
	});
	
});


//下拉刷新
function refresh(pull){
	pull.innerHTML='刷新完成';
};

//上拉加载
function reload(pull){
	pull.innerHTML='已加载全部数据';
};